<template>
  <div class="pro-vue-workflow">
    <workflow
      ref="workflow"
      :pageSize="10"
      :isHideBtn="true"
    />
  </div>
</template>
<script>
import { asyncComponent } from '../../components/asyncComponent/index.js';

const workflow = asyncComponent(() => import('./modules/workflow/workflow'));

let workflowVM;
// 刷新角标
window._worktask_refreshBadge = (badges) => {
  Ext.each(badges, (badge) => {
    // 刷新功能
    if (badge.refresh) {
      let item;
      switch (badge.type) {
        case 'WF':// 工作流列表
          item = workflowVM;
          break;
        default:
          break;
      }
      if (item) {
        item.refresh();
      }
    }
  });
};
export default {
  name: 'Workflow',
  components: {
    workflow,
  },
  mounted() {
    const me = this;
    JE.defer(() => {
      workflowVM = me.$refs.workflow;
      if (workflowVM && workflowVM.refresh) {
        return false;
      }
    }, 200);

    setTimeout(() => {//去掉待办减掉高度设定，对组件进行修改
      $('.pro-vue-workflow .listview-body').css({
        height: `${$('.pro-vue-workflow').parent().height() - 161}px`,
      });
    }, 100);
  },
};
</script>
<style lang="scss">
.pro-vue-workflow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  .el-tabs.el-tabs--top .el-tabs__item {
    padding: 0 20px;
    color: grey;
  }
  .el-tabs.el-tabs--top .el-tabs__active-bar{
      display: none;
  }
}
</style>
